{% extends 'index.html' %}

{% block body %}
<div id="head">
        <div id="img"><img src= "gui/stoccaggio48x48.png"></div>
    <div id="testo">{{ui|replace("_"," ")|capitalize()}}</div>
  </div>  <div id="rigaheader"></div>
        <table cellpadding="0" cellspacing="4" border="0">
            <tr>
                <td class = "report-header" colspan="4"><h3>Magazzino: <strong>{{dao.magazzino}}</strong></h3></td>
            </tr>
            <tr>
                <td class = "report-header" colspan="4"><h3>Articolo: <strong>{{dao.articolo}}</strong></h3></td>
            </tr>
	<tr><TD></TD></tr>
	</table>

	<table cellpadding="0" cellspacing="0" border="0">
            <tr><td colspan="4" class="table-header">Dati stoccaggio</td></tr>
            <tr>
                <td width="20%" class="odd-detail">Scorta minima</td>
                <td width="30%" class="odd-detail"><strong>{{dao.scorta_minima}}</strong></td>
                <td width="20%" class="odd-detail">Livello riordino</td>
                <td width="30%" class="odd-detail"><strong>{{dao.livello_riordino}}</strong></td>
            </tr>
            <tr>
                <td width="20%" class="even-detail" >Data fine scorte</td>
                <td class="even-detail">
                    {% if dao.data_fine_scorte %}
                        <strong>{{utils.dateToString(dao.data_fine_scorte)}}</strong>
                    {% endif %}
                </td>
                <td width="20%" class="even-detail" >Data prossimo ordine</td>
                <td class="even-detail">
                     {% if dao.data_prossimo_ordine %}
                        <strong>{{utils.dateToString(dao.data_prossimo_ordine)}}</strong>
                    {% endif %}
                </td>
            </tr>
</table>
<table cellpadding="0" cellspacing="0" border="0">
            <tr><td colspan="5" class="table-header">Situazione magazzino</td></tr>
            <tr class="even-detail">
                <td width="74%" style="padding-left:20px;" > Dati Movimento</td>
                <td class="even-number" style="text-align:center;" width="10%">Quantita'</td>
                <td class="even-number" style="text-align:center;" width="10%">Valore</td>
                <td class="even-number" style="text-align:center;" width="4%">+/-</td>
            </tr>
            {% for item in dao.totaliOperazioniMovimento %}
            <tr >
            <td class="odd-detail" style="padding-left:5px;"><strong>N° {{item['numero']}} - {{item['operazione']}} - Del: {{utils.dateToString(item['data_movimento'])}} - Rag_soc.:{{item['fornitore'][0:9]|string}}{{item['cliente'][0:9]|string}} </strong></td>
            <td class="odd-number" style="text-align:center;" >{{'%14.2f' % (item['giacenza'],)}}</td>
            <td class="odd-number" style="text-align:center;">{{'%14.2f' % item['valore']|abs}}</td>
                <td class="odd-number" style="text-align:center;" >{{item['segnoOperazione']}}</td>
            </tr>
            {% endfor %}
            <tr>
                <td class="totale-detail"><strong>Totali</strong></td>                
                <td class="totale-number" style="text-align:center;"><strong>{{'%14.2f' % (dao.giacenza, )}}</strong></td>
                <td class="totale-number" style="text-align:center;"><strong>{{'%14.2f' % (dao.valoreGiacenza, )}}</strong></td>
            </tr>
        </table>
{% endblock %}